#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <math.h>
#include <string.h>

#include <omp.h>

#define PI 3.14159265
#define CORES 2 

typedef struct
{
	int numberOfPulsesPerBurst;
	int numberOfBursts;
	int * staggerFactor;
	int * timeBurstPauseRel;
	double tObservationTotal;
	float fNyquistTotal;
	int N;
	double * t;
	float * fNyquist;
	float * tObservation;
	float * df;
} sampling;

typedef struct
{
	float noiseamp;
	float amp;
	float noiseToAmpRatio;
	double freq;
	double phase;
	int length;
	double * t;
	double * samplesRe;
	double * samplesIm;
	double *Re;
	double *Im;
} signal;

void calcSamplingTime(sampling * s, int * dt0);
void calcSignal(signal * s, sampling * samp, double * df0, double freq, double amp);
void addSignal(signal * s1, signal * s2);
void abspeichern(double * arrayx, int laenge, char * text);
void calcSampledSignal(signal * s, sampling * samp);
void clean(double* Re,double* Im,int sizeValues,int NFreq,double* freq, double* tsampled,double* fDet,int maxIter, double * Window_Re, double * Window_Im,double* sinArray, double* cosArray, double* P_Re, double* P_Im, double* P_abs, double* Erg);
void peak(double* Erg,int range,double* P);
void NDFT(double* Re,double* Im,int sizeValues,double* freq, double* tsampled, int start, int ende, double* P_Re, double* P_Im,double* P_abs,double * Erg,double* sinArray, double* cosArray);
void NDFTWindow(double* Re,double* Im, int sizeValues, int NFreq,double* freq, double* tsampled);
